<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>hiphp</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">账号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="account" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>

        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
                <button class="layui-btn layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
                <!-- <button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button> -->
            </div>
        </script>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
            <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
        </script>
    </div>
</div>
<script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script type="module">
    import * as hi from '../../js/common/main.js'

    hi.page(() => {
        hi.getList({
            url: hi.ADMIN_LIST,
            cols: [
                {field: 'LAY_INDEX',title: '#',width:80,align:'center', templet: function(d) {
                    return d.LAY_INDEX
                }},
                {field: 'id',title: 'ID', hide: true, width: 100},
                {field: 'account',title: '账号',width: 150},
                {field: 'name',title: '名称',width: 150},
                {field: 'group_name',title: '权限组',width:150},
                {field: 'status',title: '状态',templet:function(d) {
                    return d.status ? '<b style="color:green">启用</b>' : '<em style="color:#ccc">停用</em>'
                },width:150},
                {title: '操作', toolbar: '#currentTableBar', align: "center", width:150, fixed: 'right'},
            ]
        })
    })
</script>

</body>
</html>